#include "reg52.h"
#include "intrins.h"

#define uint  unsigned int 
#define uchar unsigned char

void delay_ms(uint );

void main(void)
{
	uint i =0;
	uint a = 0x01; 
	
	while(1)
	{

		a = 0x01;
		P2 =~a;
		delay_ms(500);
		for(i = 0; i < 7; i++)
		{
			a = a << 1;
			P2 = ~a;
			delay_ms(500);
		}
		for(i = 0; i < 7; i++)
		{
			a = a >> 1;
			P2 = ~a;
			delay_ms(500);
		}
		if(i == 7)
		{
			i = 0;
		}
	}
}

void delay_ms(uint x)
{
	uint i = 0, j = 0;
	for(j = 0;j < x;j++)
		for(i = 0; i < 110;i++);
}